﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Trippy.Levels;

namespace Trippy.CollidableGameComponents.Agents
{
    public class Agent : CollidableGameComponent
    {
        public Vector2 BounceVelocityVector {get; set;}
        public Vector2 JumpVelocityVector {get; set;}

        public Agent(Level level)
            : base(level)
        {
        }

        public virtual void HitGround(float y, Vector2 vel = new Vector2())
        {
            Velocity = new Vector2(Velocity.X, 0.0f);
            SetBottomY(y);
        }

        public virtual void Bounce(float y)
        {
            Velocity += BounceVelocityVector;
            SetBottomY(y - 1);
        }

        public virtual void HitCeiling(float y)
        {
            Velocity = new Vector2(Velocity.X, 0.0f);
            SetTopY(y + 2);
        }

        public virtual void HitLeftWall(float x)
        {
            Velocity = new Vector2(0.0f, Velocity.Y);
            SetLeftX(x + 1);
        }

        public virtual void HitRightWall(float x)
        {
            Velocity = new Vector2(0.0f, Velocity.Y);
            SetRightX(x - 1);
        }

        public virtual void Jump()
        {
            Velocity += JumpVelocityVector;
        }

    }
}
